Ext.define('PJ.view.trainingmanagement.CourseTree', {
    extend: 'AM.default.DefaultTree',
    alias: ['widget.trainingTree','widget.trainingmanagementPreChoisedList'],
    
    initComponent: function(){
    	this.store = Ext.create('PJ.'+ prototype +'.trainingmanagement.CourseTree');
    	var newParams = {
    		searchFrameType:1
        };
        // 4.0强制更改store参数写法
        var params = this.store.proxy.extraParams;
        Ext.apply(params, newParams);
        this.store.isLoad = true;
        this.callParent(arguments);
    },
		listeners: {
			//显示树的一级菜单
            load: function(treeStore, node, records, successful, eOpts){
                if (records != null && node.hasChildNodes()) {
                    this.expandNode(records[0]);
                    isExp = false;
                }
            },
			itemClick: function(){
			var me=this;
			var store =  me.up("container").down("trainingmanagementPreChoisedList").getStore();
			var record=me.getSelectionModel().getSelection();
            var newParams = {
                deptId: record[0].data.id,
                noDeptID:me.scopeDepartmentIds.getValue(),
                searchTreeType:1
            };
            // 4.0强制更改store参数写法
            var params = store.proxy.extraParams;
            Ext.apply(params, newParams);
            // grid加载生效
            store.isLoad = true;
            store.load();
			}
		}
});
